using System;
using System.Collections.Generic;

using Jedi.DOM;
using Jedi.Does;

namespace Jedi {

public class Jedi {
	private static void Create(string file) {
		Worktable.One.Program = new Program();
		Worktable.One.Save(file);
	}

	public static void Main (params string[] args) {
		switch(args.Length) {
			case 0: Create("kot.dom"); break;
			case 1: Create(args[0]); break;
			case 2: 
				Worktable.One.Load(args[0]);
				List<Do> dos = LIMOX<List<Do>>.Deserialize(args[1]);
				Worktable.One.Execute(dos);
				Worktable.One.Save(args[0]);
				break;
		}
	}
}

}